package wps.event {

import flash.events.Event;

import wps.constant.FilterConst;
import wps.model.SettingFilter;

public class FiltersChangeEvent extends Event {

    //--------------------------------------------------------------------------
    //
    // Constants
    //
    //--------------------------------------------------------------------------

    public static const STATUS_CHANGE:String = "filterStatusChange";

    public static const REMOVE:String = "removefilter";

    //--------------------------------------------------------------------------
    //
    // Properties
    //
    //--------------------------------------------------------------------------

    //----------------------------------
    // filter
    //----------------------------------

    private var _filter:SettingFilter;

    /**
     * 状态发生变化的filter
     */
    public function get filter():SettingFilter {
        return _filter;
    }

    public function set filter(filter:SettingFilter):void {
        _filter = filter;
    }

    //--------------------------------------------------------------------------
    //
    // Constructor
    //
    //--------------------------------------------------------------------------

    /**
     * 当filter变化时抛出的事件
     * @param filter SettingFilter对象
     */
    public function FiltersChangeEvent(type:String, data:Object) {
        super(type, true);

        _filter = SettingFilter(data);
        if (!_filter) {
            throw new Error("[FilterStatusChangeEvent] " + FilterConst.ERR_PARAM);
        }
    }

}

}
